import Vue from "vue";
import Router from "vue-router";

const Login = () => import("../views/login");
const Home = () => import("../views/home");
const Admin = () => import("./admin");

const routes = [
  { path: "/", redirect: "/admin/home" },
  { path: "/login", component: Login },
  {
    path: "/admin",
    component: Admin,
    redirect: "/admin/home",
    children: [
      // { path: "/admin/home", component: Home }
      { path: "home", component: Home }
    ]
  }
];

Vue.use(Router);

export const router = new Router({
  routes
});
